package org.ycsoft.PathComputation;


public class Main {
    
    public static void main(String[] args){
    	CityMap map = new CityMap();
    	String name = "paris_data.txt";
    	if(args.length != 0)
    	{
    		name = args[0];
    		name = name.trim();
    	}
		map.createMap(name);
		//compute trees
		String filename = "map.mtd";
		int i = name.indexOf('.');
		if(i != -1){
			filename = name.substring(0, i);
			if(filename.endsWith("_data"))
				filename = filename.substring(0,filename.length()-5);
			filename += ".mtd";
		}
		
		map.computeShortestPaths();
		try{
			System.out.print("Export de la carte vers "+filename+" ...");
			map.exportToMetroid(filename);
			System.out.println("OK");
			
		}catch(Exception e){
			e.printStackTrace();
		}
    }
            
    
} 
